#include <stdio.h>

int main()
{
    int length,i,b,c;
    int s[100];
    printf("Enter length \n");
    scanf("%d",&length);

    for (i=0;i<=length-1;i++)
      {
          s[i]=i+1;
      }



 for(b=1;b<=length-1;b++)
 {
     if (s[b]!=0)
     {
             for(i=b+1;i<=length-1;i++)
               {
                 if ((s[i]%(b+1))==0)
                  {
                   s[i]=0;
                  }
               }
     }
 }

 for(b=0;b<=length-1;b++)
 {
     if(s[b]!=0)
     {
         printf("%d\n", s[b]);
     }
 }
}
